#version 300 es
precision mediump float;
uniform sampler2D sTexture ;
uniform sampler2D sTexture1 ;
uniform float uDh ;

in vec2 vTexCoors ;
in float currY;

out vec4 fragColor ;
void main(){
    vec4 color1 = texture(sTexture , vTexCoors) ;
    vec4 color2 = texture(sTexture1 , vTexCoors) ;

    if(currY < 0.0f){
        fragColor = color1 ;
    }else if(currY > uDh){
        fragColor = color2 ;
    }else{
        float bili = currY/uDh ;
        fragColor = color2*bili + (1.0f-bili)*color1;
    }


}